import request from '@/utils/request'

const libraryPrefix = '/library'

// 获取文档分类树形结构（通过父ID）
export function libraryCategoryTreeByParentId(args) {
  return request({
    url: libraryPrefix + '/LibraryCategoryInfo/treeByParentId?',
    method: 'POST',
    data: args
  })
}

// 获取文档分类树形结构（通过ID）
export function libraryCategoryTreeById(args) {
  return request({
    url: libraryPrefix + '/LibraryCategoryInfo/treeById?id=' + args.id,
    method: 'POST',
    data: args
  })
}

// 查询文档分类
export function libraryCategorySelect(args) {
  return request({
    url: libraryPrefix + '/LibraryCategoryInfo/select',
    method: 'POST',
    data: args
  })
}

// 插入文档分类
export function libraryCategoryInsert(args) {
  return request({
    url: libraryPrefix + '/LibraryCategoryInfo',
    method: 'POST',
    data: args
  })
}

// 更新文档分类（通过主键ID）
export function libraryCategoryUpdateById(args) {
  return request({
    url: libraryPrefix + '/LibraryCategoryInfo/' + args.id,
    method: 'PUT',
    data: args
  })
}

// 删除文档分类（通过主键ID）
export function libraryCategoryDelete(args) {
  return request({
    url: libraryPrefix + '/LibraryCategoryInfo/force',
    method: 'DELETE',
    data: args
  })
}

